import { getHomeList } from "@/api";
const actions = {
  // 获取首页的数据
  async getHomeList({ commit, state, dispatch }) {
    let result = await getHomeList();
    if (result.code == 200) {
      commit("GETHOMELIST", result.data);
    }
  },
};
const mutations = {
  GETHOMELIST(state, data1) {
    state.homeList = data1;
  },
};
const state = {
  homeList: {},
};
const getters = {
  swiperPhotos(state) {
    return state.homeList.data.focusList;
  },
  policyDescList(state) {
    // console.log(state);
    return state.homeList.data.policyDescList || [];
  },
  kingKongModule() {
    return state.homeList.data.kingKongModule || {};
  },
};
export default {
  state,
  mutations,
  actions,
  getters,
};
